import { instance } from '@/utils/request'

export const checkOrder = (mode, obj) => {
  return instance.get('/checkout/order', {
    params: {
      mode,
      delivery: 10,
      couponId: 0,
      isUsePoints: 0,
      ...obj
    }
  })
}

export const orderList = (params) => {
  return instance.get('/order/list', { params })
}

export const submitOrder = (mode, obj) => {
  const param = {
    mode,
    delivery: 10,
    couponId: 0,
    isUsePoints: 0,
    payType: 10,
    ...obj
  }
  console.log(`param = ${JSON.stringify(param)}`)
  return instance.post('/checkout/submit', param)
}
